home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / wtj201.zip / KIYOOKA.ZIP / HEAPTEST.C < prev    next >
C/C++ Source or Header  |  1992-10-23  |  4KB  |  102 lines

  1. //Filename: HEAPTEST.C                                      
  2. //"HEAPTEST" Generated by WindowsMAKER Professional         
  3. //Author: Gen Kiyooka                                       
  4.  
  5. //
  6. // Code in this file is initially generated  by WindowsMAKER Professional. 
  7. // This file contains the WINMAIN and the MAINWINPROC functions.
  8. // You can override the functionality supplied by WindowsMAKER Professional 
  9. // by adding your own code or replacing calls in this file.  For example if 
  10. // you want to change the normal flow of events and bring up a login box 
  11. // before the main window is displayed, you would add the code here.
  12. // For more information see the section "How Code is Generated" in the 
  13. // documentation. 
  14.  
  15.  
  16. #include <WINDOWS.H>
  17. #include "HEAPTEST.H"
  18.  
  19. WMPDEBUG
  20. #include "HEAPTEST.WMC"
  21.  
  22. //*************************************************************
  23. //               WinMain FUNCTION                              
  24. //*************************************************************
  25.  
  26. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  27.     {
  28.     MSG msg;                    // message                                  
  29.  
  30.     hInst = hInstance;          // Saves the current instance               
  31.  
  32.     if (!BLDInitApplication(hInstance,hPrevInstance,&nCmdShow,lpCmdLine))
  33.         return FALSE;
  34.  
  35.     if (!hPrevInstance)         // Is there an other instance of the task   
  36.         {
  37.         if (!BLDRegisterClass(hInstance))
  38.             return FALSE;       // Exits if unable to initialize            
  39.         }
  40.  
  41.     MainhWnd = BLDCreateWindow(hInstance);
  42.     if (!MainhWnd)              // Check if the window is created           
  43.         return FALSE;
  44.  
  45.     ShowWindow(MainhWnd, nCmdShow);  // Show the window                     
  46.     UpdateWindow(MainhWnd);          // Send WM_PAINT message to window     
  47.  
  48.     BLDInitMainMenu(MainhWnd);  // Initialize main menu if necessary   
  49.  
  50.     while (GetMessage(&msg,     // message structure                        
  51.                       0,        // handle of window receiving the message   
  52.                       0,        // lowest message to examine                
  53.                       0))       // highest message to examine               
  54.         {
  55.         if (BLDKeyTranslation(&msg)) // WindowsMAKER code for key translation 
  56.             continue;
  57.         TranslateMessage(&msg); // Translates character keys                
  58.         DispatchMessage(&msg);  // Dispatches message to window             
  59.         }
  60.     BLDExitApplication();       // Clean up if necessary                    
  61.     return(msg.wParam);         // Returns the value from PostQuitMessage   
  62. }
  63.  
  64.  
  65.  
  66. //*************************************************************
  67. //           WINDOW PROCEDURE FOR MAIN WINDOW                  
  68. //*************************************************************
  69.  
  70. LONG FAR PASCAL BLDMainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam )
  71.     {
  72.  
  73.     switch (message)
  74.         {
  75.  
  76.     case WM_CREATE:             // window creation                          
  77.         // Send to BLDDefWindowProc in (.WMC) for controls in main window   
  78.         return BLDDefWindowProc(hWnd, message, wParam, lParam);
  79.         break;
  80.  
  81.     case WM_SETFOCUS:           // window is notified of focus change       
  82.         // Send to BLDDefWindowProc in (.WMC) for controls in main window   
  83.         return BLDDefWindowProc(hWnd, message, wParam, lParam);
  84.         break;
  85.  
  86.     case WM_DESTROY:            // window being destroyed                   
  87.         PostQuitMessage(0);
  88.         return BLDDefWindowProc(hWnd, message, wParam, lParam);
  89.         break;
  90.  
  91.     case WM_COMMAND:            // command from the main window             
  92.         if (BLDMenuCommand(hWnd, message, wParam, lParam))
  93.             break;              // Processed by BLDMenuCommand.             
  94.         // else default processing by BLDDefWindowProc.                  
  95.     default:
  96.         // Pass on message for default processing                           
  97.         return BLDDefWindowProc(hWnd, message, wParam, lParam);
  98.         }
  99.     return FALSE;               // Returns FALSE if processed               
  100.     }
  101.  
  102.